<template>
  <div class="digitalReportFilterList">
    <div class="box_left">
      <Common-Slider-Bar
        ref="silderBar"
        :item-view-option="{
          itemTitle: 'ENTERPRISENAME',
          key: 'ROWNUM',
          menuTitle: 'ENTERPRISENAME'
        }"
        :request="{
          url: url + '/dynamicReportForm/queryBodyByProduce',
          method: 'post',
          data: {
            pageIndex: 0,
            pageSize: 100,
            pageType: 1,
            tableId: 391,
            filterList: []
          }
        }"
        :search-key="'PROGRAMNAME'"
        @select="selectData"
      />
    </div>
    <div class="box_right">
      <table-common
        :menu-id="menuId"
        :title="title"
        :filter-list="filterList"
      />
    </div>

  </div>
</template>

<script>
import CommonSliderBar from '@/components/CommonSliderBar';
import baseUrl from '@/utils/processRequest1';
import tableCommon from '@/components/tableCommon/index.vue';
export default {
  name: 'DigitalReportFilterList',
  components: {
    tableCommon,
    CommonSliderBar
  },
  data() {
    return {
      menuId: undefined,
      title: '',
      filterList: [],
      url: ''
    };
  },
  created() {
    const { menuId, title, ENTERPRISECODE } = this.$route.query;
    this.init();
    this.menuId = Number(menuId);
    this.title = title;
    this.filterList = [{
      col: 'ENTERPRISECODE', value: ENTERPRISECODE
    }];
  },
  methods: {
    init() {
      baseUrl().then(res => {
        this.url = res.url;
        this.Year = localStorage.getItem('chooseYear');
        this.$nextTick(() => {
          this.$refs.silderBar.send();
        });
      });
    },
    selectData(val) {
      this.filterList = [{
        col: 'ENTERPRISECODE', value: val.value.ENTERPRISECODE
      }]
      ;
    } }
};
</script>

<style lang="scss" scoped>
  .digitalReportFilterList{
    height: 100%;
    display: flex;
    justify-content: space-between;
  }
  .box_left{
    width: 13%;
    background: #ffffff;
  }
  .box_right{
    width: 86%;
  }
</style>
